package com.shop2cn.iapi.delivery.parameter.enums;

import java.util.HashMap;
import java.util.Map;

/**
 *
 */
public enum CheckBizResultEnum {

	passed(0, "通过"),

	//所有非贝海运单
	billNoRuleError(1001, "物流公司和运单号不匹配"),
	billNoRelatedOtherSellerError(1002, "运单跨买手使用"),
	expressUnavailableError(1003, "发货物流公司不可用"),
	expressCompanyNeedMobile(1007, "发货物流公司必须提供手机号码"),
	expressCompanyWrongMobile(1008, "手机号码格式错误"),

	//贝海直邮贝海保税
	xloboBillNoRuleError(2001, "非贝海运单"),
	xloboBillNoSignedError(2002, "贝海运单已经签收/过期"),
	xloboBillNoRelatedOrderError(2003, "面单号与订单号无关联关系"),
	xloboProxyBillNoError(2004, "贝海代理的运单"),

	//第三方直邮、第三方保税、进口贸易检查
	orderStatusError(3001, "订单状态错误"),
	sameReceiverMaxError(3002, "相同收件人发货数量超限"),
	billNoRelatedOtherOrderFromDBError(3003, "运单已被其它订单使用(已发货)"),
	billNoRelatedOtherOrderFromSelfError(3004, "运单已被其它订单使用（未发货）"),
	billNoRelatedOtherLogisticsTypeError(3005, "运单不能跨物流方式订单使用"),

	//拼邮检查
	packageInterDeliveredError(4001, "订单发货状态必须为国际段待发货"),
	packageTranShipInterNotDeliveryError(4002, "转运发货拼邮国际段未发"),
	packageTranShipDomesticDeliveryError(4003, "转运发货拼邮国内已发货"),
	packageChinaShipInterNotDeliveryError(4004, "国内发货拼邮国际段未发"),
	packageOrderStatusError(4005, "拼邮溯源订单状态错误"),
	packageOverdoseDeliveryError(4006, "拼邮数量超限"),
	packageChinaShipDomesticDeliveryError(4007, "国内已发货"),

	//拼邮数量检查
	packageBillNoAssociatedMaxError(4006, "拼邮数量超限"),
	packageMicroShopBillNoAssociatedMaxError(4007, "直播微店拼邮数量超限"),
	packageChinaSameReceiverMaxError(4008, "拼邮国内发货相同收件人发货数量超限"),
	//拼邮阶段检查
	packageBillNoDeliveryOtherSectionError(4009, "运单被其他拼邮订单的转运段或国内段发货"),
	packageMultipleSectionError(4010, "当前订单在一个请求中存在多个发货节点"),
	packageMultipleTranShipError(4011, "拼邮订单出现多个转运段"),

	//导入发货
	importDuplicateOrderIdError(5001, "重复的订单号"),
	importErrorBatchTypeError(5002, "此订单不适用此批量发货类型"),
	importBatchTypeError(5003, "批量导入类型错误"),

	//异常情况
	tradingDeliveryError(9001, "订单发货错误"),
	logisticsTypeError(9002, "订单配送方式错误"),
	deliverySectionError(9003, "发货段错误"),
	
	// 新发货bizCode
	orderNotExists(10001, "订单不存在"),
	orderStatusNotShip(10002, "订单不是【待发货】状态，不能进行发货操作；"),
	billNoRepeat(10003, "运单号不能重复使用"),
	billNoExpire(1004, "该运单号已过期"),
	xloboDelivery(1005, "仅支持使用贝海物流发货"),
	xloboDeliveryCantUpdateNoXlobo(1006, "使用贝海发货的订单不能修改为其他物流公司发货哦"),
	modifyDeliveryInfoNotExists(1007, "发货记录不存在!"),
	orderStatusShipped(10008, "订单不是【已发货】状态，不能进行修改/补录操作；"),
	moreAuthenticatePackage(10009, "包含鉴别商品的订单不能发多个鉴别包裹"),
	openApiAuthenticateProduct(10010, "订单包含鉴别商品，openApi必须包含鉴别爆过才能发货"),
	orderNotContainAuthenticateProduct(10011, "订单不包含鉴别商品"),
	authenticateOrderMustHasAuthenticatePackage(10012, "鉴别订单必须有一条鉴别包裹的物流信息"),
    billNoNotExists(10013, "发货运单号不能为空"),
    virtualOrderDontNeedBillNo(10014, "虚拟发货不支持填写物流信息"),
    orderJustChinaDelivery(10015, "国内发货、保税区发货仅发境内段物流信息"),
    importIntelDelivery(10016, "不能发国内段物流"),
    importChinaDelivery(10017, "不能发国际段物流"),
	authenticateOrderNormalPackage(10020, "包含鉴别商品的订单不能发多个普通包裹");

	private static final Map<Integer, CheckBizResultEnum> maps = new HashMap<>();

	static {
		for (CheckBizResultEnum e : CheckBizResultEnum.values()) {
			maps.put(e.getCode(), e);
		}
	}

	int code;

	String message;

	CheckBizResultEnum(int code, String message) {
		this.code = code;
		this.message = message;
	}

	public static CheckBizResultEnum findByCode(int code) {
		return maps.get(code);
	}

	public int getCode() {
		return code;
	}

	public void setCode(int code) {
		this.code = code;
	}

	public String getMessage() {
		return message;
	}

	public void setMessage(String message) {
		this.message = message;
	}
}
